const path = require('path');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const CLIENT = {
    entry: './src/index.ts',
    mode: 'none',
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          use: 'ts-loader',
          exclude: /node_modules/
        }
      ]
    },
    resolve: {
      extensions: [ '.tsx', '.ts', '.js' ]
    },
    output: {
      filename: 'index.js',
      path: path.resolve(__dirname, 'dist'),
      // library: 'LotteryLogic', // 以库的形式导出入口文件
      libraryTarget: 'this'// 以库的形式导出入口文件时，输出的类型。这里你导出的方法变量会挂载到window.demo上，适用于使用方通过window对象访问
    },
    // optimization: {
      // minimize: true
    // },
    plugins: [new CleanWebpackPlugin()]
};
module.exports = [CLIENT];